<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>面试题_综合</title>
</head>
<body>
<script type="text/javascript">
  function Foo() {
    getName = function () { alert (1); };
    return this;
  }
  Foo.getName = function () { alert (2);};
  Foo.prototype.getName = function () { alert (3);};
  // getName = function(){ alert (5);}
  var getName = function () { alert (4);};
  function getName() { alert (5);}


  //请写出以下输出结果：
  Foo.getName(); // 2
  getName(); // 4
  Foo().getName(); // 1
  getName();// 1
  new Foo.getName(); // 2
  new Foo().getName(); // 3
  new new Foo().getName();// 3


  var foo = new Foo();


  console.log(123);
  alert(123);
  console.log(1, console.log(2, console.log(3))); // 3 2 undefined 1 undefined
  console.log(console.log());
</script>
</body>
</html>